<%--
  Created by IntelliJ IDEA.
  User: 甘汝雷
  Date: 2017/5/2
  Time: 14:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--解析表达式--%>
<%@ page isELIgnored="false" %>
<%--引入jstl--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%--引入springMVC form--%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="page" uri="/xianzhiOA/pageTag" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>工作量分布一览</title>
    <script type="application/javascript">
        function edit(type) {
            if (type==0){
                document.getElementById("workingForm").action = "${pageContext.request.contextPath}/Working/workingEdit.emp?workingId=0";
                document.getElementById("workingForm").submit();
            }else {
                document.getElementById("workingForm").action = "${pageContext.request.contextPath}/Working/workingEdit.emp?workingId="+type;
                document.getElementById("workingForm").submit();
            }
        }

        function deleteCheck(id) {
            if (confirm("确定要删除吗")) {
                window.location.href = "${pageContext.request.contextPath}/Working/deleteWorking.emp?workingId="+id;
            }
        }
    </script>
</head>
<body>
<!--头部开始-->
<jsp:include page="headerBack.jsp"></jsp:include>
<!-- 导航 -->
<jsp:include page="leftBack.jsp"></jsp:include>
<div class="main">
    <!--内容页头部-->
    <div class="page-header">
        <div class="pull-left">
            <ol class="breadcrumb visible-sm visible-md visible-lg">
                <li><a href="${pageContext.request.contextPath}/Login/goHomePage"><i class="icon fa fa-home"></i>主页</a></li>
                <li class="active"><i class="fa fa-pencil"></i>基本信息</li>
            </ol>
        </div>
        <div class="pull-right">
            <h2>主页</h2>
        </div>
    </div>
    <sf:form id="workingForm" action="${pageContext.request.contextPath}/Working/selWorkingAll.emp" modelAttribute="working" method="post" class="search1">
        <div style="height: 40px">
            <a href="${pageContext.request.contextPath}/Working/selWorkingAll.emp" class="three btn btn-primary">返回</a>
            <button onclick="edit(0)" type="button" class="three btn btn-primary">添加</button>
            <button onclick="edit(${working.workingId})" type="button" class="three btn btn-primary">修改</button>
        </div>

    </sf:form>
        <div class="well">
            归属项目：${working.project.projectName} 周期：${working.workingTimeBegin}~${working.workingTimeEnd} 周代码行数：${working.workingWeekCodes}行
            <table class="table" id="now">
                <thead>
                <tr>
                    <th class="vv">阶段</th>
                    <th class="vv">计划（比例）</th>
                    <th class="vv">实际（比例）</th>
                    <th class="vv">计划（工作量）</th>
                    <th class="vv">实际（工作量）</th>
                    <th class="vv">偏差率</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${working.phaseList}" var="p">
                    <tr>
                        <td>
                            <c:if test="${p.phaseName==1}">需求分析</c:if>
                            <c:if test="${p.phaseName==2}">设计</c:if>
                            <c:if test="${p.phaseName==3}">编码</c:if>
                            <c:if test="${p.phaseName==4}">测试</c:if>
                        </td>
                        <td>${p.phasePlansc}%</td>
                        <td>${p.phaseActualsc}%</td>
                        <td>${p.phasePlan}小时</td>
                        <td>${p.phaseActual}小时</td>
                        <td>${p.bias}%</td>
                    </tr>
                </c:forEach>
                <tr>
                    <th>合计</th>
                    <th>${working.workingPlansc}%</th>
                    <th>${working.workingActualsc}%</th>
                    <th>${working.workingPlan}小时</th>
                    <th>${working.workingActual}小时</th>
                    <th>${working.bias}%</th>
                </tr>
                </tbody>
            </table>
        </div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/dist/backEnd/js/datetime.js"></script>
</body>
</html>
